﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DeployGames.TweenEngine.equations
{
    public abstract class Sine : TweenEquation
    {
        private static float PI = 3.14159265f;

        public static SineIN IN = new SineIN();
        public static SineOUT OUT = new SineOUT();
        public static SineINOUT INOUT = new SineINOUT();

        #region SineIN
        public class SineIN : Sine
        {
            public override float compute(float t)
            {
                return (float)-Math.Cos(t * (PI / 2)) + 1;
            }

            public override string ToString()
            {
                return "Sine.IN";
            }
        }
        #endregion

        #region SineOUT
        public class SineOUT : Sine
        {
            public override float compute(float t)
            {
                return (float)Math.Sin(t * (PI / 2));
            }

            public override string ToString()
            {
                return "Sine.OUT";
            }
        }
        #endregion

        #region SineINOUT
        public class SineINOUT : Sine
        {
            public override float compute(float t)
            {
                return -0.5f * ((float)Math.Cos(PI * t) - 1);
            }

            public override string ToString()
            {
                return "Sine.INOUT";
            }
        }
        #endregion
    }
}
